- page_title "成员"

.group-members-page.prepend-top-default
  - if can?(current_user, :admin_group_member, @group)
    .panel.panel-default
      .panel-heading
        增加成员到群组
      .panel-body
        %p.light
          群组成员可以访问全部群组项目。
        .new-group-member-holder
          = render "new_group_member"

    = render 'shared/members/requests', membership_source: @group, requesters: @requesters

  .panel.panel-default
    .panel-heading
      %strong #{@group.name}
      群组成员
      %span.badge= @members.size
      .controls
        = form_tag group_group_members_path(@group), method: :get, class: 'form-inline member-search-form'  do
          .form-group
            = search_field_tag :search, params[:search], { placeholder: '使用名字查找已存在的成员', class: 'form-control', spellcheck: false }
          = button_tag class: 'btn', title: '搜索' do
            = icon("search")
    %ul.content-list
      = render partial: 'shared/members/member', collection: @members, as: :member
    = paginate @members, theme: 'gitlab'

:javascript
  $('form.member-search-form').on('submit', function(event) {
    event.preventDefault();
    Turbolinks.visit(this.action + '?' + $(this).serialize());
  });
